import 'package:ai_model/generated/json/base/json_convert_content.dart';
import 'package:ai_model/app/core/network/data/basic_entity.dart';

BasicEntity $BasicEntityFromJson(Map<String, dynamic> json) {
  final BasicEntity basicEntity = BasicEntity();
  final String? code = jsonConvert.convert<String>(json['code']);
  if (code != null) {
    basicEntity.code = code;
  }
  final String? message = jsonConvert.convert<String>(json['message']);
  if (message != null) {
    basicEntity.message = message;
  }
  return basicEntity;
}

Map<String, dynamic> $BasicEntityToJson(BasicEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['code'] = entity.code;
  data['message'] = entity.message;
  return data;
}

extension BasicEntityExtension on BasicEntity {
  BasicEntity copyWith({
    String? code,
    String? message,
  }) {
    return BasicEntity()
      ..code = code ?? this.code
      ..message = message ?? this.message;
  }
}